package com.hsteach.framework.feign.client.upload;

import com.hsteach.framework.feign.ClientConstant;
import com.hsteach.framework.feign.client.auth.AuthFeignConfig;
import com.hsteach.framework.feign.client.auth.dto.AuthResp;
import com.hsteach.framework.feign.client.upload.dto.UploadEntity;
import com.hsteach.framework.feign.client.upload.vo.UploadRet;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(name = "uploadClient", url = "${interface.upload.domain:127.0.0.1:8079}", configuration = AuthFeignConfig.class)
public interface UploadClient {

    @PostMapping(value = "/restful/files/uapi/upload/push", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    AuthResp<UploadRet> push(@RequestHeader(ClientConstant.AUTH_ACCESS_TOKEN) String accessToken,
                             @RequestHeader(ClientConstant.AUTH_APP_TOKEN) String appToken,
                             @RequestHeader(ClientConstant.AUTH_OPERATE_CODE) String operateCode,
                             UploadEntity fileAndForm);
}
